﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
namespace yaa
{
    public partial class WebForm6 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            string oldName=this.FileUpload1.PostedFile.FileName;//包含路径
            FileInfo fileInfo = new System.IO.FileInfo(oldName);
            string extension =fileInfo.Extension;//含小数点
            string time = string.Format("{0:yyyyMMddHHmmssffffff}", DateTime.Now);
            string newName =Server.MapPath("~/NewFolder1/")+ time + extension;
            this.FileUpload1.SaveAs(newName);


        }
    }
}